Self-similar group actions may be encoded by a class of left cancellative monoids called left Rees monoids.This connection was discovered by Perrot and the first author who subsequently generalized it to self-similar groupoid actions and a class of categories called left Rees categories. In this paper, we prove that the theory of Rees categories, that is the left Rees categories which are actually cancellative, may be viewed as a generalization of the classical theory of graphs of groups as developed by Serre and the groupoid approach to that theory by Philip Higgins. Using a standard construction, we also show that the theory of graphs of groups may be viewed as part of the theory of inverse semigroups. This enables us to prove that the Serre tree associated with a graph of groups can be constructed using Ehresmann's maximum enlargement theorem. This shows the close connection that exists between the theory of graphs of groups and McAlister's classical P-theorem within inverse semigroup theory.